package com.hzwq.common;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
    /**
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myHandlerInterceptor());
    }
    /***
     * MyHandlerInterceptor自己定义的拦截器
     * @author 沉鱼
     * @date 2017年12月28日 下午2:39:32
     * @return MyHandlerInterceptor
     */
    @Bean
    public MyInterceptor myHandlerInterceptor() {
        return new MyInterceptor();
    }
}
